<template>
  <div>
    <!-- 自定义头部 -->
    <u-navbar title="库存预警">
      <div slot="right">
        <div class="btn" @click="update">完成</div>
      </div>
    </u-navbar>
    <div class="name padding-0-32">
      <u-input height="94" :focus="true" maxlength="16" v-model="stockWarning" placeholder="" type="number" :border="false" />
    </div>

  </div>
</template>

<script>
import { updateStockWarning } from "@/api/shops";
export default {
  data() {
    return {
      stockWarning: 0, // 库存预警数量
    };
  },
  methods: {
    async update() {
      let res = await updateStockWarning({stockWarning:this.stockWarning});
      if(res.data.success){
          uni.navigateBack();
      }
    },
    onLoad(options) {
      this.stockWarning = options.num;
    },
  },
};
</script>

<style lang="scss" scoped>
.name {
  background: #f3f5f7;
  margin-bottom: 32rpx;
}
.padding-0-32 {
  padding: 0 32rpx;
}

.btn {
  display: inline;
  padding: 12rpx 32rpx;
  background: #333;
  border-radius: 10rpx;
  font-size: 24rpx;
  color: #fff;
  margin-right: 24rpx;
}
</style>